package com.w7vm.menuweb.dao;

import javax.ejb.Stateless;
import javax.ejb.TransactionAttribute;
import javax.ejb.TransactionAttributeType;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

import com.w7vm.menuweb.entity.RestauranteFilialInfraestruturaWeb;

@Stateless
public class RestauranteFilialInfraestruturaDAO extends GenericDAO<RestauranteFilialInfraestruturaWeb> {

	
	@PersistenceContext(unitName = "MENUWEB-IAM-EJB")
	private EntityManager em;

	
	public RestauranteFilialInfraestruturaDAO() {
		super(RestauranteFilialInfraestruturaWeb.class);
		// TODO Auto-generated constructor stub
	}
	
	@TransactionAttribute(TransactionAttributeType.REQUIRED)
	public void deleteInfraestrutura(RestauranteFilialInfraestruturaWeb infraObj){
		System.out.println("[CORE-EJB][deleteInfraestrutura] :");
		
			infraObj = em.find(RestauranteFilialInfraestruturaWeb.class, infraObj.getIdRestauranteFilialInfraestruturaWeb());
			if(infraObj != null){
				em.remove(infraObj);
				em.flush();
			}
	}

}
